<template lang="html">
<div class="shopCommon">
  <el-row >
    <el-col :xs="24" :sm="{span:6,offset:0}" :md="{span:4,offset:0}" :lg="{span:2,offset:0}" class="common-s">
      <el-menu mode="vertical" default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
          <el-menu-item-group title="淘梦地带">
            <el-menu-item index="1" @click="two">我的淘梦</el-menu-item>

          </el-menu-item-group>
          <el-menu-item-group title="账单记录">
            <el-menu-item index="2" @click="two">消费记录</el-menu-item>
            <el-menu-item index="3" @click="two">提现记录</el-menu-item>
            <el-menu-item index="4" @click="two">兑换记录</el-menu-item>
            <el-menu-item index="5" @click="two">淘豆流水</el-menu-item>
            <el-menu-item index="6" @click="two">额度流水</el-menu-item>

          </el-menu-item-group>
        </el-menu>
    </el-col>
    <el-col :xs="24" :sm="{span:18,offset:0}" :md="{span:20,offset:0} " :lg="{span:22,offset:0}" class="common-search">
      <el-col :xs="24" :sm="{span:13,offset:0}" :md="{span:8,offset:8}" :lg="{span:6,offset:12}">
        <div class="block">

    <el-date-picker  v-model="value7" type="daterange"  align="right" placeholder="选择日期范围" :picker-options="pickerOptions2">
    </el-date-picker>
  </div>
      </el-col>
      <el-col :xs="24" :sm="{span:8,offset:1}" :md="{span:4,offset:0}" :lg="{span:4,offset:0}">
        <el-input placeholder="搜索" icon="search" v-model="input2" :on-icon-click="handleIconClick">
          </el-input>
      </el-col>


    </el-col>
    <el-col :xs="24" :sm="{span:16,offset:0}" :md="{span:19,offset:0} " :lg="{span:21,offset:0}" class="common-main">
      <router-view></router-view>
    </el-col>
  </el-row>
</div>
</template>

<script>
export default {
    data() {
        return {
            input2: '',
            pickerOptions2: {
                shortcuts: [{
                    text: '最近一周',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近一个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近三个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                        picker.$emit('pick', [start, end]);
                    }
                }]
            },
            value6: '',
            value7: ''
        }
    },
    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        },
        handleIconClick(ev) {
            console.log(ev);
        },
        two(ev) {
            if (ev.index == 1) {
                this.$router.push("/user/shopCommon/dream")
            } else if (ev.index == 2) {
                this.$router.push("/user/shopCommon/expenseRecord")
            } else if (ev.index == 3) {
                this.$router.push("/user/shopCommon/withdrawalsRecord")
            } else if (ev.index == 4) {
                this.$router.push("/user/shopCommon/conversionRecord")
            } else if (ev.index == 5) {
                this.$router.push("/user/shopCommon/TDRecord")
            } else if (ev.index == 6) {
                this.$router.push("/user/shopCommon/limitRecord")
            }
        }

    }
}
</script>

<style lang="css">

.shopCommon{

  background-color: #FFF;
}
/*.common-s{

  height: 900px;


  box-shadow: 0px 5px 10px #575757;
}
.common-search{
  height: 60px;
  background-color: #FFF;
  margin-top: 0px;
  margin-bottom: 10px;
  box-shadow: 0px 5px 10px #575757;
}
.common-main{
  background: #aaa;
  height: 820px;
  margin-left: 2%;

}
.el-menu{
  background-color: #FFF;
}*/
</style>
